import axios from "./axios";

// 登录
export const login = (data) =>
    axios.post('/user/login', data)

export const register = (data) =>
    axios.post('/user/register', data)
export const postUser = (data) =>
    axios.post('/user', data)
export const changeUser = (data) =>
    axios.post('/user/changeUser', data)


export const getUser = (params) =>
    axios.get(`user`, { params })

// 获取教师表，新增教师，修改教师
export const getTeacher = (params) =>
    axios.get(`teacher`, { params })

export const postTeacher = (data) =>
    axios.post('teacher', data)


export const changeTeacher = (data) =>
    axios.post('/teacher/changeTeacher', data)
export const delTeacher = (data) =>
    axios.post('/teacher/delTeacher', data)

// 获取学生表，新增学生，修改学生

export const getStu = (params) =>
    axios.get(`stu`, { params })

export const postStu = (data) =>
    axios.post('stu', data)
export const changeStu = (data) =>
    axios.post('/stu/changeStu', data)
export const delStu = (data) =>
    axios.post('/stu/delStu', data)

export const changeInfo = (data) =>
    axios.post('/user/change', data)

export const uploadAvatar = (data) =>
    axios.post('/user/uploadAvatar', data)

export const getMenu = (params) =>
    axios.get('/user/menu', { params })

export const getTodayClass = (params) =>
    axios.get('/todayClass', { params })
export const getSub = (params) =>
    axios.get('/getSub', { params })

export const addSubApi = (data) =>
    axios.post('/getSub/add', data)
export const delSubApi = (data) =>
    axios.post('/getSub/del', data)

export const getClass = (params) =>
    axios.get('/getClass', { params })
export const addClassApi = (data) =>
    axios.post('/getClass/add', data)

export const deleteClassApi = (data) =>
    axios.post('/getClass/delete', data)

export const getClassContext = (params) =>
    axios.get('/getClassContext', { params })
export const changeClassDetail = (data) =>
    axios.post('/classContext/change', data)
export const addClassDetail = (data) =>
    axios.post('/classContext/add', data)
export const deleteClassContext = (data) =>
    axios.post('/classContext/delete', data)


export const getClassStu = (params) =>
    axios.get('/getClassStu', { params })
